package org.uim.cricket.util.io;

import java.io.*;

public class FileSaver {

	private String theFile = null;
	
	public FileSaver(String filename) {
		theFile = filename;
	}
	
	public void write(StringBuilder sb) throws IOException {
		FileWriter writer = new FileWriter(theFile);
		
		writer.write(sb.toString());
		writer.flush();
		
		writer.close();
	}
	
	public void write(StringBuffer sb) throws IOException {
		FileWriter writer = new FileWriter(theFile);
		
		writer.write(sb.toString());
		writer.flush();
		
		writer.close();
	}
	
	public void setTheFile(String theFile) {
		this.theFile = theFile;
	}
	
	public String getTheFile() {
		return theFile;
	}
	
}
